using System;
using System.Collections.Generic;

using AppPriceLive.Entities.Utils;
using AppPriceLive.Entities.Models;
using AppPriceLive.DAL;
using AppPriceLive.Common;

namespace AppPriceLive.Biz
{
	public class CurrencyInfoService
	{
		/// <summary>
		/// Saves a record to the CurrencyInfo table.
		/// </summary>
		public virtual void Insert(CurrencyInfoInfo currencyInfoInfo)
		{
			try
			{
				new CurrencyInfoDAO().Insert(currencyInfoInfo);
			}
			catch (Exception ex)
			{
				Logger.Error("AppPriceLive.Biz.CurrencyInfo - Insert", ex);
				throw;
			}

		}

		/// <summary>
		/// Saves a record to the CurrencyInfo table.
		/// </summary>
		public virtual void Update(CurrencyInfoInfo currencyInfoInfo)
		{
			try
			{
				new CurrencyInfoDAO().Update(currencyInfoInfo);
			}
			catch (Exception ex)
			{
				Logger.Error("AppPriceLive.Biz.CurrencyInfo - Update", ex);
				throw;
			}

		}

        /// <summary>
        /// Cap nhat gia mua vao ban ra
        /// </summary>
        /// <param name="currencyInfoInfo"></param>
        public virtual void Update_BigAndAsk(CurrencyInfoInfo currencyInfoInfo)
        {
            try
            {
                new CurrencyInfoDAO().Update_BigAndAsk(currencyInfoInfo);
            }
            catch (Exception ex)
            {
                Logger.Error("AppPriceLive.Biz.CurrencyInfo - Update_BigAndAsk", ex);
                throw;
            }

        }

		/// <summary>
		/// Delete a record from the CurrencyInfo table.
		/// </summary>
		public virtual void Delete(int? currencyListId)
		{
			try
			{
				new CurrencyInfoDAO().Delete(currencyListId);
			}
			catch (Exception ex)
			{
				Logger.Error("AppPriceLive.Biz.CurrencyInfo - Delete", ex);
				throw;
			}

		}

		/// <summary>
		/// Selects a single record from the CurrencyInfo table.
		/// </summary>
		public virtual CurrencyInfoInfo Select(int? currencyListId)
		{
			try
			{
				return new CurrencyInfoDAO().Select(currencyListId);
			}
			catch (Exception ex)
			{
				Logger.Error("AppPriceLive.Biz.CurrencyInfo - Select", ex);
				throw;
			}

		}

		/// <summary>
		/// Selects all records from the CurrencyInfo table.
		/// </summary>
		public List<CurrencyInfoInfo> SelectAll()
		{
			try
			{
				return new CurrencyInfoDAO().SelectAll();
			}
			catch (Exception ex)
			{
				Logger.Error("AppPriceLive.Biz.CurrencyInfo - SelectAll", ex);
				throw;
			}

		}

	}
}
